#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include <QtWidgets/QDialog>

class SettingsManager;
class QSpinBox;
class QLineEdit;
class QCheckBox;
class QPushButton;
class QGroupBox;

class SettingsDialog : public QDialog
{
    Q_OBJECT

public:
    explicit SettingsDialog(SettingsManager *settingsManager, QWidget *parent = nullptr);
    ~SettingsDialog();

private slots:
    void loadSettings();
    void saveSettings();
    void browseDownloadPath();

private:
    void setupUI();

    SettingsManager *m_settingsManager;
    
    // 下载设置控件
    QSpinBox *m_maxConcurrentSpinBox;
    QSpinBox *m_speedLimitSpinBox;
    QLineEdit *m_downloadPathEdit;
    QSpinBox *m_maxRetriesSpinBox; // 添加最大重试次数控件
    
    // 代理设置控件
    QCheckBox *m_useProxyCheckBox;
    QLineEdit *m_proxyHostEdit;
    QSpinBox *m_proxyPortSpinBox;
    
    // 用户界面设置控件
    QCheckBox *m_notificationCheckBox;
    QCheckBox *m_startOnAddCheckBox;
    
    // 按钮
    QPushButton *m_okButton;
    QPushButton *m_cancelButton;
    QPushButton *m_browseButton;
};

#endif // SETTINGSDIALOG_H